#pragma once
#include<iostream>
enum class States{
	State1,
	State2,
	State3

	//...
};

class ClassA {
public:
	States state;

public:
	ClassA(): state(States::State1){};

public:
	//类似策略模式中的例子	strategy
	//if - else Bad Smell
	void DoWork1() {
		if (state == States::State1) {
			std::cout << "States::State1 DoWork1" << std::endl;
			//TODO ...
			state = States::State2;
		}

		else if (state == States::State2) {
			std::cout << "States::State2 DoWork1" << std::endl;
			//TODO ...
			state = States::State3;
		}

		//else if ...
	}

	void DoWork2() {
		if (state == States::State1) {
			std::cout << "States::State1 DoWork2" << std::endl;
			//TODO ...
			state = States::State3;
		}

		else if (state == States::State2) {
			std::cout << "States::State2 DoWork2" << std::endl;
			//TODO ...
			state = States::State1;
		}

		//else if ...
	}

	//DoWork3 ...
};